#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QModelIndex>
#include "Highlighter.h"
#include "TextEditor.h"
#include <QStandardItemModel>

class Completer;
class Parser;

class MainWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    void runDebugger( QString & fileName );
    
private:
    TextEditor * editor;
    Highlighter * highlighter;
    Completer * completer;
    Parser * parser;
    QStandardItemModel * mdl;

    void deployMenu();
    void makeWordsTree();
    QAbstractItemModel * getModel( const QString & file, QStandardItemModel * model = 0 );
    void loadModel();

public slots:
    void sltOpenFile( const QString & f = QString() );
    void sltSaveAsFile();
    void sltNewFile();
    void sltManageRules();
    void sltManageCompletes();
    void sltShowAllTokens();
    void sltAbout();
    void sltSetBackgroundColor();
    void sltSetFontColor();
    void sltSetWordWrap();

private slots:
    void sltReloadModel();

};

#endif // MAINWINDOW_H
